package com.vctgo.accountSet.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.vctgo.accountSet.mapper.TbProfessionMapper;
import com.vctgo.accountSet.domain.TbProfession;
import com.vctgo.accountSet.service.ITbProfessionService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vctgo.common.core.text.Convert;
import com.vctgo.common.core.utils.ServletUtils;
import com.vctgo.common.mybatisplus.constant.MybatisPageConstants;
/**
 * 行业Service业务层处理
 *
 * @author vctgo
 * @date 2024-12-16
 */
@Service
public class TbProfessionServiceImpl implements ITbProfessionService
{
    @Autowired
    private TbProfessionMapper tbProfessionMapper;

    /**
     * 查询行业
     *
     * @param id 行业主键
     * @return 行业
     */
    @Override
    public TbProfession selectTbProfessionById(Long id)
    {
        return tbProfessionMapper.selectById(id);
    }

    /**
     * 查询行业列表-分页
     *
     * @param tbProfession 行业
     * @return 行业
     */
    @Override
    public IPage<TbProfession> selectTbProfessionPage(TbProfession tbProfession)
    {
        Page mpPage =new Page(Convert.toLong(ServletUtils.getParameterToInt(MybatisPageConstants.PAGE_NUM),1L)
                ,Convert.toLong(ServletUtils.getParameterToInt(MybatisPageConstants.PAGE_SIZE),10L));
        return tbProfessionMapper.selectTbProfessionList(mpPage,tbProfession);
    }
    /**
     * 查询行业列表
     *
     * @param tbProfession 行业
     * @return 行业
     */
    @Override
    public List<TbProfession> selectTbProfessionList(TbProfession tbProfession)
    {
        return tbProfessionMapper.selectTbProfessionList(tbProfession);
    }

    /**
     * 新增行业
     *
     * @param tbProfession 行业
     * @return 结果
     */

    @Override
    public int insertTbProfession(TbProfession tbProfession)
    {
        return tbProfessionMapper.insert(tbProfession);
    }

    /**
     * 修改行业
     *
     * @param tbProfession 行业
     * @return 结果
     */
    @Override
    public int updateTbProfession(TbProfession tbProfession)
    {
        return tbProfessionMapper.updateById(tbProfession);
    }

    /**
     * 批量删除行业
     *
     * @param ids 需要删除的行业主键
     * @return 结果
     */
    @Override
    public int deleteTbProfessionByIds(Long[] ids)
    {
        return tbProfessionMapper.deleteTbProfessionByIds(ids);
    }

    /**
     * 删除行业信息
     *
     * @param id 行业主键
     * @return 结果
     */
    @Override
    public int deleteTbProfessionById(Long id)
    {
        return tbProfessionMapper.deleteById(id);
    }
}
